package com.kitty.game.item.service.handler;

import com.kitty.game.role.model.Role;
import com.kitty.game.enter.RespGeneralNotify;
import com.kitty.game.equip.service.EquipService;
import com.kitty.game.item.message.vo.MergeItemId;
import com.kitty.game.item.message.RespMergeDurableItem;
import com.kitty.game.utils.NotifyModules;
import com.kitty.mina.message.MessagePusher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**耐久物品合成抽象类*/
@Slf4j
@Component
public abstract class MergerItemHandler {

    @Resource
    protected EquipService equipService;

    public abstract void mergeItem(Role role ,List<MergeItemId> itemIdList);

    void pushResult(Role role){
        RespMergeDurableItem mergeDurableItem = new RespMergeDurableItem();
        mergeDurableItem.setFlag((byte) 1);
        MessagePusher.pushMessage(role,mergeDurableItem);

        RespGeneralNotify notify = new RespGeneralNotify();
        notify.setNotify(NotifyModules.NOTIFY_FINISH_ALCHEMY);
        notify.setValue(String.valueOf(1));
        MessagePusher.pushMessage(role, notify);
    }
}
